package com.zaofan.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zaofan.bean.AccountRank;
import com.zaofan.dao.AccountRankDao;

public class AccountRankService {

	private AccountRankDao accountRankDao = new AccountRankDao();

	public void delete(AccountRank accountRank) {
		accountRankDao.del(accountRank);
	}

	public void add(AccountRank accountRank) {
		accountRankDao.add(accountRank);
	}

	public void update(AccountRank accountRank) {
		accountRankDao.update(accountRank);
	}

	public List<AccountRank> findAll(Map<String, Object> params) {
		List<AccountRank> data = accountRankDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return accountRankDao.count(params);
	}

	public AccountRank findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return accountRankDao.findOne(params);
	}

}
